import {SUPPLIERHOTELLIST,SUPPLIERHOTEL,SUPPLIERROOMLIST,SUPPLIERCONFIGLIST,SUPPLIERROOMDELETE,SUPPLIERROOMRESTORE} from '@/services/api'
import {request, METHOD} from '@/utils/request'

/**
 * 获取酒店列表
 */
export async function getHotelList(pageIndex, pageSize, params) {
    params.pageIndex = pageIndex
    params.pageSize = pageSize
    return request(SUPPLIERHOTELLIST, METHOD.POST, params)
}

/**
 * 获取酒店
 */
export async function getHotel(supplier, supplierHotelId) {
    return request(SUPPLIERHOTEL, METHOD.GET, {supplier: supplier, supplierHotelId: supplierHotelId})
}

/**
 * 获取房型列表
 */
export async function getRoomList(pageIndex, pageSize, params) {
    params.pageIndex = pageIndex
    params.pageSize = pageSize
    return request(SUPPLIERROOMLIST, METHOD.POST, params)
}

/**
 * 删除房型信息
 * @param params
 * @returns {Promise<*>}
 */
export async function deleteRooms(params) {
    return request(SUPPLIERROOMDELETE, METHOD.POST, params)
}

/**
 * 恢复房型信息
 * @param params
 * @returns {Promise<*>}
 */
export async function restoreRooms(params) {
    return request(SUPPLIERROOMRESTORE, METHOD.POST, params)
}

/**
 * 获取配置列表
 */
export async function getConfigList() {
    return request(SUPPLIERCONFIGLIST, METHOD.GET)
}